package newcoder.lx_求int型正整数在内存中存储时1的个数;

import java.util.Scanner;

/**
 * @Author Mr.wang
 * @Description
 * @Date 2020-04-11
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int nextInt = scanner.nextInt();
            String s = toBinary(nextInt);
            String s1 = s.replaceAll("1", "");
            System.out.println(s.length()-s1.length());
        }
    }

    public static String toBinary(int nextInt) {
        return Integer.toBinaryString(nextInt);
    }
}
